/**
 * 
 */
package com.wolfpire.info.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wolfpire.info.dao.TeachingMaterialsCountDao;
import com.wolfpire.info.model.TeachingMaterialsCount;
import com.wolfpire.info.service.TeachingMaterialsCountService;
import com.wolfpire.system.common.Constants;
import com.wolfpire.system.common.Page;
import com.wolfpire.system.common.base.dao.IBaseHibernateDao;
import com.wolfpire.system.common.base.service.impl.BaseHibernateService;

/**
 * @author lihd
 *
 */

@Service("teachingMaterialsCountService")
public class TeachingMaterialsCountServiceImpl extends
		BaseHibernateService<TeachingMaterialsCount, Long> implements
		TeachingMaterialsCountService {

	@Override
	public List<TeachingMaterialsCount> list(TeachingMaterialsCount teachingMaterialsCount) {
		return this.teachingMaterialsCountDao.list(teachingMaterialsCount);
	}

	@Override
	public void del(Long id) {
		TeachingMaterialsCount teachingMaterialsCount = this.teachingMaterialsCountDao.get(id);
		if (null != teachingMaterialsCount) {
			teachingMaterialsCount.setDelFlag(Constants.DELETE_FLAG);
			this.teachingMaterialsCountDao.saveOrUpdate(teachingMaterialsCount);
		}
	}

	@Override
	public Page<TeachingMaterialsCount> setPageDataList(
			Page<TeachingMaterialsCount> page,
			TeachingMaterialsCount filterTeachingMaterialsCount) {
		return this.teachingMaterialsCountDao.findTeachingMaterialsCounts(page, filterTeachingMaterialsCount);
	}

	@Override
	protected IBaseHibernateDao<TeachingMaterialsCount, Long> getEntityDao() {
		return this.teachingMaterialsCountDao;
	}
	
	@Resource private TeachingMaterialsCountDao teachingMaterialsCountDao;
}
